<template>
    <div>
       <table>
        <tr>
            <td>名称</td>
            <td><input type="text" v-model="state.name"></td>
        </tr>
        <tr>
            <td>密码</td>
            <td><input type="text" v-model="state.pwd"></td>
        </tr>
        <tr>
            <td>手机号</td>
            <td><input type="text" v-model="state.phone"></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="button" value="登录"></td>
        </tr>
       </table>
    </div>
</template>

<script setup lang="ts">
import { reactive, toRefs } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import axios from 'axios';

let data = reactive({
    state: {
        name: '',
        pwd: '',
        phone: ''
    }
})
let { state } = toRefs(data);

const add=()=>{
    let obj={
        id: 0,
  name: state.value.name,
  pwd: state.value.pwd,
  sex: "男",
  phone: state.value.phone,
  age: 20
    }
    axios({
        url:'',
        method:'post',
        data:obj
    })
    .catch()
}


</script>

<style scoped></style>